package com.wangyuan.po;

public class User {

    private Integer userId;
    private String username;
    private String password;

    /**
     * 空参构造
     */
    public User() {

    }

    /**
     * 带参构造
     * @param userId
     * @param username
     * @param password
     */
    public User(Integer userId, String username, String password) {
        this.userId = userId;
        this.username = username;
        this.password = password;
    }

    /**
     * 静态内部 Builder 类 -- 别学我这样写，一般是implement一个接口或者用Lombok来实现建造者。
     @author Albert
     @date 2025-06-21 20:53:34
     @return
     */
    public static class UserBuilder {
        private Integer userId;
        private String username;
        private String password;

        public UserBuilder setUserId(Integer userId) {
            this.userId = userId;
            return this;
        }

        public UserBuilder setUsername(String username) {
            this.username = username;
            return this;
        }

        public UserBuilder setPassword(String password) {
            this.password = password;
            return this;
        }

        public User build() {
            return new User(userId, username, password);
        }
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}